app.controller('btnCtrl', ['$scope', '$http', BtnController]);
function BtnController($scope, $http){
    console.log('------$scope.menuId1-----', $scope.menuId);
    console.log('------$scope.buttonArr1-----', $scope.buttonArr);

    $scope.bindBtn = function(event) {
        var datas = $scope.getSelectedRows();
        var t = this;
        switch(event){
            case 'event-to-setCoefficient':
            {
                $scope.showModalLink('/web/business/tpAnalysisDailyTargetSet/toSetCoefficient?setType=1', '设置目标系数');
                break;
            }
            case 'event-to-setDailyTarget':
            {
                if(datas.length == 0) {
                    layer.alert('尚未选中数据');
                } else if(datas.length > 1) {
                    layer.alert('只能选中一行数据');
                } else {
                    $scope.showModalLink('/web/business/tpAnalysisDailyTargetSet/toSetDailyTarget?id=' + datas[0].id + '&dailyTarget='+ datas[0].elaborateDailyTarget+ '&setType=1', '设置日目标');
                }
                break;
            }
        };
    }
}
